package ma.ac.onousc.gestionfi.budget.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;

/**
 * The persistent class for the etablissement database table.
 * 
 */
@Entity
@NamedQueries({
		@NamedQuery(name = "Etablissement.findSiege", query = "select o from Etablissement o where o.etablissement = null"),
		@NamedQuery(name = "Etablissement.findCUs", query = "select o from Etablissement o where o.etablissement <> null"),
		@NamedQuery(name = "Etablissement.findAllNonSoumis", query = "select o from Etablissement o where o.idEtablissement not in (select s.etablissement.idEtablissement from Soumettre s where s.programmeEmploi.idProgrammeEmploi = :ANNEE and s.etablissement.idEtablissement <> NULL )") })
public class Etablissement implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID_ETABLISSEMENT")
	private int idEtablissement;

	@Column(name = "ADRESSE_ETABLISSEMENT")
	private String adresseEtablissement;

	@Column(name = "EMAIL_ETABLISSEMENT")
	private String emailEtablissement;

	@Column(name = "FAX_ETABLISSEMENT")
	private String faxEtablissement;

	@Column(name = "NOM_ETABLISSEMENT")
	private String nomEtablissement;

	@Column(name = "SITE_ETABLISSEMENT")
	private String siteEtablissement;

	@Column(name = "TELEPHONE_ETABLISSEMENT")
	private String telephoneEtablissement;

	// bi-directional many-to-one association to Etablissement
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "ID_ETABLISSEMENT_SIEGE")
	private Etablissement etablissement;

	// bi-directional many-to-one association to Etablissement
	@OneToMany(mappedBy = "etablissement")
	private Set<Etablissement> etablissements;

	// bi-directional many-to-one association to Ville
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_VILLE")
	private Ville ville;

	// bi-directional many-to-one association to Personnel
	@OneToMany(mappedBy = "etablissement")
	private Set<Personnel> personnels;

	// bi-directional many-to-one association to RubriqueBudgetaire
	@OneToMany(mappedBy = "etablissement")
	private Set<RubriqueBudgetaire> rubriqueBudgetaires;

	// bi-directional many-to-one association to Soumettre
	@OneToMany(mappedBy = "etablissement")
	private Set<Soumettre> soumettres;

	public Etablissement() {
	}

	public int getIdEtablissement() {
		return this.idEtablissement;
	}

	public void setIdEtablissement(int idEtablissement) {
		this.idEtablissement = idEtablissement;
	}

	public String getAdresseEtablissement() {
		return this.adresseEtablissement;
	}

	public void setAdresseEtablissement(String adresseEtablissement) {
		this.adresseEtablissement = adresseEtablissement;
	}

	public String getEmailEtablissement() {
		return this.emailEtablissement;
	}

	public void setEmailEtablissement(String emailEtablissement) {
		this.emailEtablissement = emailEtablissement;
	}

	public String getFaxEtablissement() {
		return this.faxEtablissement;
	}

	public void setFaxEtablissement(String faxEtablissement) {
		this.faxEtablissement = faxEtablissement;
	}

	public String getNomEtablissement() {
		return this.nomEtablissement;
	}

	public void setNomEtablissement(String nomEtablissement) {
		this.nomEtablissement = nomEtablissement;
	}

	public String getSiteEtablissement() {
		return this.siteEtablissement;
	}

	public void setSiteEtablissement(String siteEtablissement) {
		this.siteEtablissement = siteEtablissement;
	}

	public String getTelephoneEtablissement() {
		return this.telephoneEtablissement;
	}

	public void setTelephoneEtablissement(String telephoneEtablissement) {
		this.telephoneEtablissement = telephoneEtablissement;
	}

	public Etablissement getEtablissement() {
		return this.etablissement;
	}

	public void setEtablissement(Etablissement etablissement) {
		this.etablissement = etablissement;
	}

	public Set<Etablissement> getEtablissements() {
		return this.etablissements;
	}

	public void setEtablissements(Set<Etablissement> etablissements) {
		this.etablissements = etablissements;
	}

	public Ville getVille() {
		return this.ville;
	}

	public void setVille(Ville ville) {
		this.ville = ville;
	}

	public Set<Personnel> getPersonnels() {
		return this.personnels;
	}

	public void setPersonnels(Set<Personnel> personnels) {
		this.personnels = personnels;
	}

	public Set<RubriqueBudgetaire> getRubriqueBudgetaires() {
		return this.rubriqueBudgetaires;
	}

	public void setRubriqueBudgetaires(
			Set<RubriqueBudgetaire> rubriqueBudgetaires) {
		this.rubriqueBudgetaires = rubriqueBudgetaires;
	}

	public Set<Soumettre> getSoumettres() {
		return this.soumettres;
	}

	public void setSoumettres(Set<Soumettre> soumettres) {
		this.soumettres = soumettres;
	}

}